export type DetailFormType = {
  stock_code: string;
  serial_no: string;
  system: string;
  car: string;
  workgroup: string;
  detail_description: string;
  description: string;
  date_code: string;
  sw_ver: string;
  hw_ver: string;
  obsolescence: number;
  asset_id: string;
  equipmentClass: string;
  lv1: string;
  lv2: string;
  lv3: string;
  lv4: string;
  lv5: string;
  parent_part_stock_code: string;
  parent_part_serial_number: string;
  stock_item_regular_cycle_month: number;
};

export interface ItemForm {
  stockCode: string;
  system: string;
  workgroup: string;
  car: string;
  shortDescription: string;
  detailDescription: string;
  dateCode: string;
  swVer: string;
  hwVer: string;
  obsolescence: number;
  asset_id: string;
  equipmentClass: string;
  lv1: string;
  lv2: string;
  lv3: string;
  lv4: string;
  lv5: string;
  parent_stock_item_stock_code: string;
  global_regular_cycle_month: number;
}

export interface NFFRecord {
  id: number;
  stock_code: string;
  system: string;
  serial_no: string;
  description: string;
  sw_ver: string;
  hw_ver: string;
  work_group: string;
  failure_sym: string;
  deliver_to: string;
  maintenance_type: string;
  test_status: string;
  check_in: string;
  check_out: string;
}

export interface HistoryReport {
  id: number;
  system: string;
  serial_no: string;
  stock_code: string;
  work_group: string;
  deliver_to: string;
  check_in: string;
  check_out: string;
}

export interface StockList {
  id: number;
  system: string;
  serial_no: string;
  stock_code: string;
  description: string;
  sw_ver: string;
  work_group: string;
}

export interface StockItem {
  id: number;
  stock_code: string;
  system: string;
  sequence?: number;
  short_description: string;
}

export interface FormOptions {
  systemOpts: string[];
  lv1Opts: string[];
  lv2Opts: string[];
  lv3Opts: string[];
  lv4Opts: string[];
  lv5Opts: string[];
}

export interface Parts {
  id: number;
  stock_code: string;
  serial_no: string;
  system: string;
  car: string;
  location: string;
  workgroup: string;
  description: string;
  date_code: string;
  sw_ver: string;
  hw_ver: string;
  assets: string;
  equipmentClass: string;
  lv1: string;
  lv2: string;
  lv3: string;
  lv4: string;
  lv5: string;
  lv6: string;
  sequence?: number;
  qr_code: string;
  create: string;
  last_check_in: string;
  last_check_out: string;
  last_status: string;
  last_status_details: string;
  purchase_date: string;
  image: string;
  io_counter: string;
  detail_description: string;
  deliver_to: string;
  parent_part?: number;
  parent_part_stock_code: string;
  parent_part_serial_number: string;
  is_parent: boolean;
  obsolescence: number;
}

export interface RepairOrder {
  id: number;
  cews_order: string;
  serial_no: string;
  work_order_no: string;
  car: string;
  mtce_type: string;
  report_date: string;
  location: string;
  department: string;
  failure_symptom: string;
  eqpt_description: string;
  remark: string;
  status: string;
  io_counter: string;
  workgroup: string;
  check_in: string;
  parent_work_order_no: string;
  contractor_liability: string;
  dlc_form_no: string;
  designated_person_name: string;
  date: string;
  order_no: string;
  check_in_date: string;
}

export interface CheckInOrder {
  id: number
  cews_order_no: string;
  stock_code: string;
  serial_no: string;
  work_order_no: string;
  car: string;
  mtce_type: string;
  report_date: string;
  location: string;
  department: string;
  failure_symptom: string;
  description: string;
  remark: string;
  status: string;
  io_counter: string;
  workgroup: string;
  parent_work_order_no: string;
  contractor_liability: string;
  dlc_form_no: string;
  designated_person_name: string;
  date: string;
  line: string;
  line_work_order: string;
  check_in_date: string;
  equipment: string;
  delay_i: string;
  delay_a: string;
  po_no?: string;
  inspection_no?: string;
  received_date?: string;
}

export interface ChildItem {
  id: number;
  stock_code: string;
  serial_number: string;
  status: string;
}

export interface StockItem {
  id: number;
  stock_code: string;
  system: string;
  car: string;
  workgroup: string;
  description: string;
  date_code: string;
  sw_ver: string;
  hw_ver: string;
  obsolescence: number;
  lv1: string;
  lv2: string;
  lv3: string;
  lv4: string;
  lv5: string;
  lv6: string;
  create: string;
  purchase_date: string | null;
  image: string;
  io_counter: string;
  detail_description: string;
  parent_stock_item: string | null;
}

export interface Task {
  id: number;
  task: string;
  description: string;
  mtce_type: string;
  cur_tab: boolean;
  final_tab: boolean;
  wi_no: string;
}

export interface EformFiles {
  id: number;
  file: string;
  eform: number;
  created: string;
  user_id: number;
  ext: string;
  isImage: string;
  isVideo: string | boolean;
}

export interface EformSchemas {
  id: number;
  title: string;
  formNo: string;
  ref: string;
  issue: string;
  endorsor_require: boolean;
  form_issue_date: string;
  created: string;
  updated: string;
  enable: boolean;
}

export interface StockItemTask {
  id: number;
  name: string;
  eform_schema_id: number;
  stock_item: number;
  mtce_type: string;
  cur_tab: boolean;
  final_tab: boolean;
  formNo: string;
}

export interface RepairOrderTask {
  id: number;
  has_eform: boolean;
  is_eform_created: boolean;
  stock_code: string;
  serial_no: string;
  repairing_action: string;
  role: string;
  role_result: string;
  role_timestamp: string;
  eform_id: number;
  eform_schema_id: number;
  repair_order: number;
  repair_order_part: number;
  stock_item_task: number;
  eform_progress: number;
  is_endorse_required: boolean;
  mtce_type: string;
  cur_tab: boolean;
  final_tab: boolean;
}

export interface StockItemImpWork {
  id: number;
  stock_code: string;
  doc_name: string;
  description: string;
  complete: number;
  invalid: number;
  stock_item: number;
  version: string;
  file: string;
}
export interface StockItemEDoc {
  id: number;
  stock_code: string;
  doc_name: string;
  description: string;
  complete: number;
  invalid: number;
  stock_item: number;
  version: string;
  file: string;
}
export interface ChildStockItem {
  child: StockItem;
  sequence: number;
}

export interface StockItemHTReplacement {
  id: number;
  stock_code: string;
  component: string;
  period: number;
}

export interface PartItemHTReplacement {
  component: string;
  stock_code: string;
  serial_no: string;
  last_replaced: string;
  next_replace: string;
  replace: string;
}

export interface OrderHTReplacement {
  id: number;
  order_id: number;
  component: string;
  stock_code: string;
  serial_no: string;
  last_replaced: string;
  next_replace: string;
  replace: string;
  complete: boolean;
  order_only: boolean;
}

export interface RepairOrderEDoc {
  id: number;
  stock_code: string;
  doc_name: string;
  description: string;
  complete: number;
  version: string;
  repair_order: number;
  file_url: string;
}

export interface RepairOrderImpWork {
  id: number;
  stock_code: string;
  doc_name: string;
  description: string;
  complete: number;
  version: string;
  repair_order: number;
  file_url: string;
}

export interface Version {
  id: number;
  stock_code: string;
  hw_ver: string;
  sw_ver: string;
  update: string;
}

export interface CurrentLatestVersion {
  repair_order_part_version_id: number;
  repair_order_part_id: string;
  stock_code: string;
  serail_no: string;
  current_sw_ver: string;
  current_hw_ver: string;
  latest_sw_ver: string;
  latest_hw_ver: string;
  sw_ver_correct: boolean;
  hw_ver_correct: boolean;
}

export interface RepairOrderPart {
  id: number;
  stock_code: string;
  outer_inner: string;
  serial_no: string;
  system: string;
  description: string;
  date_code: string;
  sw_ver: string;
  hw_ver: string;
  fitment: string;
  last_check_in: string;
  last_check_out: string;
  sequence: number;
  qr_code: string;
  status: string;
  status_details: string;
  io_counter: string;
  detail_description: string;
  deliver_to: string;
  repair_order: number;
  parent_part: number;
}

export interface RepairOrderPartVersion {
  id: number;
  stock_code: string;
  sw_ver: string;
  hw_ver: string;
  update: string;
  repair_order: number;
  repair_order_part: RepairOrderPart;
}

export interface StatusDetail {
  outstanding: number;
  message: string[];
  log_parts: string[];
}

export interface RepairOrderCheckStatus {
  part_detail: StatusDetail;
  current_task: StatusDetail;
  software: StatusDetail;
  hardware: StatusDetail;
  edoc: StatusDetail;
  hard_time_replacement: StatusDetail;
  final_check: StatusDetail;
}

export interface RepairOrderParts {
  id: number;
  stock_code: string;
  outer_inner: string;
  serial_no: string;
  system: string;
  description: string;
  date_code: string;
  sw_ver: string;
  hw_ver: string;
  fitment: string;
  last_check_in: string;
  last_check_out: string;
  sequence: number;
  qr_code: string;
  status: string;
  status_details: string;
  io_counter: string;
  detail_description: string;
  deliver_to: string;
  repair_order: number;
  parent_part: number;
}

export interface OrderPart {
  stock_code: string;
  serial_no: string;
  status: string;
  repair_order: {
    id: 0;
    order_no: string;
    cews_order_no: string;
    report_date: string;
    mtce_type: string;
    work_order_no: string;
    parent_work_order_no: string;
    department: string;
    car: string;
    location: string;
    car_description: string;
    failure_symptom: string;
    remark: string;
    check_in: string;
    check_out: string;
    workgroup: string;
    system: string;
    io_counter: string;
    deliver_to: string;
  };
}
export interface Child {
  [k: number]: {
    id: number;
    sequence: string;
    stock_code: string;
    serial_no: string;
    car: string;
    sw_ver: string;
    hw_ver: string;
  };
}

export interface Parent {
  id: number;
  stock_code: string;
  serial_no: string;
  car: string;
  sw_ver: string;
  hw_ver: string;
  child: Child;
}

export interface FinalCheckForm {
  repair_order_id: number;
  repair_details: string;
  fault_equipment: string;
  fault_equipment_JSON_OBJ: { [k: string]: boolean };
  failure_symptom: string;
  actions: string;
  remarks: string;
  delivery_to: string;
  scrapped: boolean;
  deleted: boolean;
  maintenance_type: string;
  repeat_within_six_months: string;
  spare_part: string;
  maintenance_details: string;
  test_result: string;
}

export interface PartsEDoc {
  id: number;
  stock_code: string;
  serial_no: string;
  doc_name: string;
  description: string;
  complete: number;
  invalid: number;
  file: string;
  version: string;
  deleted: boolean;
  created: string;
  stock_item: number;
  parts: number;
  maintenance_type: string;
}

export interface PartsImpWork {
  id: number;
  stock_code: string;
  serial_no: string;
  doc_name: string;
  description: string;
  complete: number;
  invalid: number;
  file: string;
  version: string;
  deleted: boolean;
  created: string;
  stock_item: number;
  parts: number;
  maintenance_type: string;
}


export interface PartMasterCheckStatus {
  part_detail: StatusDetail;
  version: {
    sw: StatusDetail;
    hw: StatusDetail;
  };
  edoc: StatusDetail;
  hard_time_replacement: StatusDetail;
}

export interface PartVersion {
  id: number;
  stock_code: string;
  sw_ver: string;
  hw_ver: string;
  update: string;
  deleted: boolean;
  parts: Parts;
}

export type ColsFilterType = {
  search: boolean;
};

export interface EventLogInterface {
  id: number;
  log_type: string;
  action_type: string;
  category_type: string;
  action: string;
  description: string;
  part: string;
  parent_part: string;
  repair_order: number;
  parent_stock_code: string;
  stock_code: string;
  timestamp: string;
  username: string;
  order_no: string;
}

export interface MaxPage {
  count: number;
}

export interface AssetRelation {
  equipment_class: string;
  lv1: string;
  lv2: string;
  lv3: string;
  lv4: string;
  lv5: string;
}

export interface FilterForm {
  section: string;
  action: string;
  sub_section: string;
  stock_code: string;
  serial_no: string;
  job_order: string;
  dateFrom: string;
  dateTo: string;
  currentPage: number;
}

export interface LogOpts {
  jo: string[];
  stock_codes: string[];
  serial_nos: string[];
  log_types: string[];
  action_types: string[];
  category_types: string[];
}

export interface RepairOrderHistory {
  id: number;
  jo: string;
  system: string;
  serial_no: string;
  stock_code: string;
  workgroup: string;
  deliver_to: string;
  check_in: string;
  check_out: string;
  part_id: number;
  status: string;
  is_parent: boolean;
  repair_details: string;
  actions: string;
  remarks: string;
}

export interface RepairOrderNFFRecord {
  id: number;
  jo: string;
  system: string;
  serial_no: string;
  stock_code: string;
  workgroup: string;
  deliver_to: string;
  check_in: string;
  check_out: string;
  part_id: number;
  status: string;
  repair_details: string;
  is_parent: boolean;
}
export interface Total {
  total: number;
}
export interface RepairingOverview {
  value: number;
  // name: string
}
[];

export interface RepairingOverviewTable {
  system: string;
  serial_no: string;
  stock_code: string;
  workgroup: string;
  deliver_to: string;
  check_in: string;
  check_out: string;
}

export interface InOutSummary {
  last7: {
    value: number;
    name: string;
  }[];
  last30: {
    value: number;
    name: string;
  }[];
  total: {
    value: number;
    name: string;
  }[];
}

export interface RegistrationSummary {
  date: string[];
  value: number[];
}

export interface OutgoingRecord {
  id: number;
  stock_code: string;
  serial_no: string;
  system: string;
  description: string;
  sw_ver: string;
  check_in: string;
  check_out: string;
  duration: string;
  category: string;
}

export interface HistorySearch {
  stock_code: string;
  equipment_class: string;
  level: string;
  location: string;
  dateFrom: string;
  dateTo: string;
}

export interface GroupSetting {
  id: number;
  enable: boolean;
  expiry_date: string;
  group: string;
  user: string;
}

export interface GroupSettingOptions {
  username: string[];
  // group : string[]
}

export interface Permission {
  id: number;
  codeName: string;
  name: string;
}

export interface Group {
  id: number;
  name: string;
}

export interface TaskGroup {
  id: number;
  group: number;
  eformSchema_id: number;
  formNo: string;
  title: string;
}

export interface StockItemGroup {
  id: number;
  group: number;
  stock_id: number;
  stock_code: string;
  description: string;
}

export interface MainRecord {
  id: string;
  action: string;
  delay_a: string;
  delay_i: string;
  eams_completed_date: string;
  equipment: string;
  finding: string;
  line: string;
  line_work_order: string;
  location: string;
  mtce_type: string;
  out_date: string;
  receive_date: string;
  report_date: string;
  send_to: string;
  serial_no: string;
  symptom: string;
  test_result: string;
  work_order_no: string;

  //not use
  io_counter: string;
  workgroup: string;
  remark: string;
}

export interface QRMapI {
  id: number;
  qr_string: string;
  stock_code: string;
  serial_no: string;
}

export interface QRLocationMapI {
  id: number;
  qr_string: string;
  category: string;
  train: string;
  description: string

}

export interface QRLocationCategoryI {
  id: number;
  category: string;
  description: string;
}

export interface SpareAvailabilityI {
  category: string[];
}

export interface DashBoardData {
  category: string[];
  data: {
    [key: string]: number[];
  };
}

export interface OldMainRecordI {
  id: number;
  report_date: string;
  receive_date: string;
  stock_code: string;
  serial_no: string;
  equipment: string;
  action: string;
  delay_a: string;
  delay_i: string;
  eams_completed_date: string;
  finding: string;
  line: string;
  line_work_order: string;
  location: string;
  mtce_type: string;
  out_date: string;
  send_to: string;
  symptom: string;
  test_result: string;
  work_order_no: string;
}

export interface PartsQR {
  SN: string
  SC: string
  encoded_image: string
  seq: number
}
export interface pdflist {
  start_date: string;
  end_date: string;
  completed: boolean;
  stock_code: string;
}
export interface splorp {
  system: string;
  stock_code: string;
  serial_no: string;
  work_group: string;
  rows: Array;
  columns: Array;
  location:string;
}
export interface meanlist {
  timerows: Array;
  timecolumns: Array;
}

export interface reportquery {
  stock_code: string;
  short_description: string;
  mtbf: string;
}

export interface columnsMix {
  label: string
  name: string
  field: string
  align: string
  sortable: boolean
}

export interface obsolescenceManagementList {
  rows: Array<obsolescenceManagement>;
  columns: Array<any>;
}


export interface obsolescenceManagement {
  stock_code: string;
  description: string;
}

export interface RegularCheck {
  serial_no: string;
  stock_code: string;
  description: string;
  cycle_month:  string;
  incoming_cycle_month:  string;
}
export interface RegularCheckList {
  rows: Array<RegularCheck>;
  columns: Array<any>;
}

export interface stockTtemSearch {
  stock_code: string;
  system: string;
  description: string;
}

export interface partsMashterSearch {
  stock_code: string;
  serial_no: string;
  description: string;
}

export interface searchDepotType{
  stock_code: string;
  serial_no: string;
  page_size?: string;
  page_num?: string
}

export interface searchTaskType {
  username: string;
  email: string;
  page_size?: number;
  page_num?: number
}
